package com.example.rydwlib.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.example.baselib.utils.TimeUtils
import com.example.rydwlib.R
import com.example.rydwlib.bean.SpecialpersonabnormaBean

/**
 * Author: sxygsj
 * Date: 2020/5/7 9:57
 * Description: 特种人员报警适配器
 * History:
 * <author> <time> <version> <desc>
 * 作者姓名 修改时间 版本号 描述
 */
class RySpecialAlarmAdapter(layoutResId: Int):BaseQuickAdapter<SpecialpersonabnormaBean,BaseViewHolder>(layoutResId) {
    override fun convert(helper: BaseViewHolder, item: SpecialpersonabnormaBean) {
        helper.setText(R.id.ry_alarm_special_name, item.personname)
            .setText(R.id.ry_alarm_special_code, item.cardnumber)
            .setText(
                R.id.ry_alarm_special_shouldtime,
                TimeUtils.timeFormat(item.shouldtime)
            ).setText(
                R.id.ry_alarm_special_realartime,
                TimeUtils.timeFormat(item.realarrivetime)
            )
            .setText(R.id.ry_alarm_special_state, item.state)
    }
}